<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:replace="~{common::css}"></div>
    <link rel="stylesheet" href="../static/lib/editor_markdown/css/editormd.min.css"
          th:href="@{/lib/editor_markdown/css/editormd.min.css}">
    <title>分类新增</title>
</head>
<body class="m-admin-add">
<!--导航-->
<div th:replace="~{common::menu(2)}"></div>
<!--二级导航-->
<div class="ui  attached pointing menu" >
    <div class="ui  container">
        <div class="right menu" >
            <a th:href="@{/admin/toType-add}"  class=" ui inverted orange  button button" >新增</a>
                <a th:href="@{/admin/toTypes/{current}(current=1)}" class=" ui   button" >管理</a>


        </div>
    </div>
</div>
<!--中间内容-->
<div class="m-padded-tb-big m-container-small">
    <div class="ui container">

            <div class="ui error message" th:unless="${#strings.isEmpty(error)}">
            <i class="close icon"></i>
            <div class="header">提示:</div>
            <p th:text="${error}"></p>
            </div>

        <form action="/insertType" class="ui form" method="post">
            <div class="field">
                <div class="ui left labeled input">

                    <label  class="ui teal basic label">名称</label>
                    <input type="text" name="name"  placeholder="分类名称" autocomplete="off" >
                </div>

            </div>
            <div class="ui error message">
            </div>
            <div class="ui right aligned container">

                <button  type="button" class="ui button" onclick="window.history.go(-1)">返回</button>

                <button class="ui teal button" type="submit"  name="save">提交</button>
                <span id="userInfo"></span>
            </div>
        </form>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
        <br/>
    </div>
</div>
<!--底部 footer-->
<div th:replace="~{common::footer}"></div>


<script src="../static/js/jquery-3.5.1.js" th:src="@{/js/jquery-3.5.1.js}"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>




    <script>


        $('.menu.toggle').click(function (){
            $('.m-item').toggleClass('m-mobile-hide');

        });
        $('.ui.dropdown').dropdown({
            on : 'hover',
        });
        $('.ui.form').form({
            fields : {
                 name : {
                    identifier : 'name',
                   rules : [{
                        type : 'empty',
                      prompt : '名字：请输入分类名字'
                   }]
                 },
            }
        });
        $('.message .close')
            .on('click', function () {
                $(this)
                    .closest('.message')
                    .transition('fade');
            });
    </script>
</body>

</html>